home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 8
/
The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO
/
pcboard
/
wall15.zip
/
WALL.PPS
< prev
Wrap
Text File
|
1996-11-23
|
42KB
|
1,180 lines
; ┌─────────────────────────────────────────────────────────────────────────┐
; │ The Wall v1.5 - Last Modified 11-23-96 The Digital Nebula BBS │
; │ By Jesse Keene (408)469-3604 │
; └─────────────────────────────────────────────────────────────────────────┘
;
; Note: This PPE *Will Not Compile* without the "/disarr" parameter
; ie, "pplc wall.pps /disarr", this is because it uses some
; multi-dimensional arrays
;
; If you find this PPE of any use, I would -=Really Appreciate=- hearing
; from you!!! You can email me via Internet at spacecb@deeptht.armory.com
DECLARE PROCEDURE Main()
DECLARE PROCEDURE PrnWall(boolean ShowBG)
DECLARE PROCEDURE PrnPos()
DECLARE PROCEDURE PrnEndLine()
DECLARE PROCEDURE LoadDAT()
DECLARE PROCEDURE SaveDAT()
DECLARE PROCEDURE SaveANS(string SavANSfilename)
DECLARE PROCEDURE SavePCB(string SavPCBfilename)
DECLARE PROCEDURE Send()
DECLARE FUNCTION Blink(byte iBG) BYTE
DECLARE FUNCTION Lock() BOOLEAN
DECLARE FUNCTION SwapBool(Boolean swp) BOOLEAN
DECLARE FUNCTION GetYN(string Prompt, boolean YN) BOOLEAN
DECLARE FUNCTION Direction(string Prompt) INT
int i, PosX,PosY, OldX,OldY
int wDAT, wASC, DirWordz
byte CurClr, CurBG
boolean prompt_flag, lock_flag, NumPad, G_Bye, BGon, BSon, LBon
boolean Load_PCB, Load_ANS, Save_PCB, Save_ANS
string cmdline, WallVer, TmpFile, LstUsrName, LstUsrAlias, nullstr, ESC
string AnsiSave, AnsiRestore, AnsiClrLine
string WallDat, WallAsc(22)
redim WallDat,22,2
WallVer="v1.5"
TmpFile="$INUSE."
CurClr=asc("7")
CurBG =asc("0")
prompt_flag=0 : lock_flag=0
Load_PCB=0 : Load_ANS=0 : Save_PCB=0 : Save_ANS=0
BGon=1 : LBon=1 : DirWordz=0
NumPad=0
ESC=chr(27)
AnsiSave= ESC+"[s"
AnsiRestore=ESC+"[u"
AnsiClrLine=ESC+"[K"
begin
getuser
if (!exist(ppepath()+"WALL.BG")) then
println "WALL.BG is missing!!!"
end
endif
cmdline = tokenstr()
tokenize cmdline
while (tokcount() > 0) do
cmdline = GetTOKEN()
if (upper(cmdline)="/PROMPT") prompt_flag=true
if (upper(cmdline)="/LOCK") lock_flag=true
if (upper(cmdline)="/LOADPCB") load_pcb=true
if (upper(cmdline)="/LOADANS") load_ans=true
if (upper(cmdline)="/SAVEPCB") save_pcb=true
if (upper(cmdline)="/SAVEANS") save_ans=true
if (upper(cmdline)="/BSON") BSon=true
if (upper(cmdline)="/BGOFF") BGon=false
if (upper(cmdline)="/LBOFF") LBon=false
endwhile
if ( (!ansion()) & (!prompt_flag) ) then
println
println "ANSI not detected"
println
println "The Wall cannot function without the use of ANSI color & positioning codes"
println
println "You should go into your terminal settings, and look for a setting where"
println "you can enable ANSI mode."
println
println "If your using some garbage term program that doesn't even have ok ANSI support"
println "[Like Windows 3.x terminal! Yech!] Get a new one that does support it"
println
CmdLine="N"
InputText " Enter the Wall (y/N) _",CmdLine,@X07,1
if (!upper(CmdLine)="Y") end
CmdLine=""
elseif ( (!ansion()) & prompt_flag) then
end
endif
GrafMode 2 ' Force ANSI Color
print ESC+"[0;1;5;37;47m@X00@X07"
if (Lock()) then
if (!prompt_flag) then
freshline
print "@X07The Wall is in use on another node, exiting"
endif
end
endif
if (prompt_flag) then
if (!GetYN("@X03Do you want to Tag on the Graffitti Wall",0)) then
if (Lock_Flag) delete ppepath()+TmpFile+string(pcbnode())
end
endif
endif
print "@POFF@@QOFF@"
if (!exist(ppepath()+"WALL.BG")) then
println "WALL.BG is missing!!!"
end
endif
LoadDAT()
cls
log "User Entered The Wall",0
Main()
SaveDAT()
if (Load_PCB | Save_PCB) SavePCB("")
if (Load_ANS | Save_ANS) SaveANS("")
fcloseall
if (Lock_Flag) delete ppepath()+TmpFile+string(pcbnode())
if (G_Bye) hangup
cls
END
PROCEDURE Main()
boolean Main_Loop, Time_Loop, Input_Flag, BG_Stat, DispClrFlag
boolean Ctrl_A, Ctrl_B, Ctrl_C, Ctrl_D, Ctrl_N, Ctrl_O, Ctrl_Q, Ctrl_R, Ctrl_T, Ctrl_Z
string KeyBuf, CmdStr, DirWnlb
byte LastClr, LastBGClr
int Result, RandC(1), LstSec
integer YoyoCount : boolean YoyoBool
Main_Loop=1 : DispClrFlag=1
if (Load_ANS) then
cls
if (BGon) dispstr "%"+ppepath()+"WALL.BG"
dispstr "%"+ppepath()+"WALL.ANS"
elseif (Load_PCB) then
cls
dispstr "%"+ppepath()+"WALL.PCB"
else
PrnWall(BGon)
endif
PrnEndLine()
PosX=2 : PosY=2
Main_Loop=1
PrnPos()
while (Main_Loop) do
KeyBuf=INKEY()
; Yoyopro Protection!!
if (upper(KeyBuf)="Y") then
if (YoyoBool=0) inc YoyoCount
YoyoBool=1
elseif (upper(KeyBuf)="O") then
if (YoyoBool=1) inc YoyoCount
YoyoBool=0
endif
; Type "yoyo" too much and the Fedz'll bust ya
if (YoyoCount > 80) then
cls
println "Federal Law Prohibits Yoyoing in CyberSpace"
log "Yoyoing Violation",1
wait
if (Lock_Flag) delete ppepath()+TmpFile+string(pcbnode())
hangup
end
endif
' Takes care of a problem with PCBoard's internal ^X/^K [Abort Output]
' and redraws the screen
if (abort()) then
BG_Stat=1
resetdisp
cls
PrnWall(BGon)
PrnEndLine() : PrnPos()
endif
select case (asc(KeyBuf))
case 1: Ctrl_A=1
case 2: Ctrl_B=1
case 3: Ctrl_C=1
case 4: Ctrl_D=1
case 14: Ctrl_N=1
case 15: Ctrl_O=1
case 17: Ctrl_Q=1
case 18: Ctrl_R=1
case 20: Ctrl_T=1
case 26: Ctrl_Z=1
end select
if (Ctrl_O) then
WallDat(PosY,0)=Left(WallDat(PosY,0),PosX-1)+chr(CurClr)+Right(WallDat(PosY,0),79-PosX)
WallDat(PosY,2)=Left(WallDat(PosY,2),PosX-1)+chr(CurBG)+Right(WallDat(PosY,2),79-PosX)
AnsiPos PosX,PosY
if (!mid(WallDat(PosY,1),PosX,1)=chr(32)) print "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)+mid(WallDat(PosY,1),PosX,1)
select case (DirWordz)
case 0: inc PosX
case 1: dec PosX
case 2: inc PosY
case 3: dec PosY
case 4: inc PosX : inc PosY
case 5: inc PosX : dec PosY
default: DirWordz=0
end select
if (PosX > 79) PosX=1
if (PosX < 1) PosX=79
if (PosY > 22) PosY=1
if (PosY < 1) PosY=22
PrnPos()
Ctrl_O=0
endif
if (Ctrl_Z) then
cls
; Don't change or remove my copyright message, or my BBS ad!
; If you do I'll Sue You for Copyright Infringment!!!
println "@X0EHelp@X06: @X4F The Wall "+WallVer+" - PCBoard PPE @POS:56@Digital Nebula (c) 1996 @X07"
dispstr "%"+ppepath()+"hlpwall"
print "@X4F The Wall @X1E from the Digital Nebula BBS [408]469-3604 @X07_"
nullstr=tinkey(0)
PrnWall(BGon)
PrnEndLine() : PrnPos()
Ctrl_Z=0
endif
if (Ctrl_D) then
AnsiPos 1,23 : print AnsiClrLine
if (LBon) then
DirWordz=Direction("@X0B Select Direction@X03: @X07")
else
DirWnlb="F"
INPUTSTR "@X0BSelect Dir@X03: @X03(@X0BF@X03)orward, (@X0BB@X03)ackward, (@X0BD@X03)own, (@X0BU@X03)p, (@X0BI@X03) Diagnal, (@X0BA@X03) Diag-Up", DirWnlb, 0Fh, 1, "fbudiaFBUDIA", FIELDLEN + GUIDE + UPCASE + ERASELINE
if (upper(DirWnlb="F")) DirWordz=0
if (upper(DirWnlb="B")) DirWordz=1
if (upper(DirWnlb="D")) DirWordz=2
if (upper(DirWnlb="U")) DirWordz=3
if (upper(DirWnlb="I")) DirWordz=4
if (upper(DirWnlb="A")) DirWordz=5
endif
PrnEndLine() : PrnPos()
Ctrl_D=0
endif
if (Ctrl_A) then
Ctrl_A=0
CmdStr=""
AnsiPos 1,23 : print "@X07",AnsiClrLine
if (NumPad) then : nullstr="ON"
else : nullstr="OFF"
endif
AnsiPos 62,23 : print "@X03(@X0BN@X03)umber Pad: @X0F"+nullstr : nullstr=""
AnsiPos 1,23 : InputText "@X03(@X0BQ@X03)uit, (@X0BH@X03)elp, Command? _",CmdStr,@X07,12
let CmdStr=upper(CmdStr)
if (CmdStr="B") Ctrl_B=TRUE
if (CmdStr="C") then
Ctrl_C=TRUE
Loop
endif
if (CmdStr="D") then
Ctrl_D=TRUE
Loop
endif
if (CmdStr="H" | CmdStr="HELP" | CmdStr="?" | CmdStr="Z") then
Ctrl_Z=TRUE
Loop
endif
if (CmdStr="N") then
Ctrl_N=TRUE
Loop
endif
if (CmdStr="O") Ctrl_O=TRUE
if (CmdStr="Q" | CmdStr="S") then
Main_Loop=0
Loop
endif
if (CmdStr="A") then
AnsiPos 1,23 : print "@X07",AnsiClrLine
if (GetYN("@X0E Abort Changes",1)) then
LoadDAT()
PrnWall(BGon)
endif
endif
if (CmdStr="R") Ctrl_R=TRUE
if (CmdStr="T") Ctrl_T=TRUE
if (CmdStr="G" | CmdStr="BYE") then
log "User Logged off thru Wall PPE",0
AnsiPos 1,23 : print "@X07",AnsiClrLine
G_Bye=1
Main_Loop=0
Loop
endif
if (CmdStr="SEND") Send()
if (CmdStr="SAVE") SaveDAT()
if (CmdStr="SAVEPCB") SavePCB("")
if (CmdStr="SAVEANS") SaveANS("")
if (CmdStr="VIEWPCB") then
if (exist(ppepath()+"WALL.PCB")) then
cls
dispstr "%"+ppepath()+"WALL.PCB"
AnsiPos 1,23 : print "@X07",AnsiClrLine
print "@X0B View of WALL.PCB ... @X0FPress Any Key to Return"
nullstr=tinkey(0)
PrnWall(BGon)
else
AnsiPos 1,23 : print "@X07",AnsiClrLine
print "@X0F WALL.PCB @X0ENot Found!!! @X07"
nullstr=tinkey(100)
endif
endif
if (CmdStr="VIEWANS") then
if (exist(ppepath()+"WALL.ANS")) then
cls
if (BGon) dispstr "%"+ppepath()+"WALL.BG"
dispstr "%"+ppepath()+"WALL.ANS"
AnsiPos 1,23 : print "@X07",AnsiClrLine
print "@X0B View of WALL.ANS ... @X0FPress Any Key@X07"
nullstr=tinkey(0)
PrnWall(BGon)
else
AnsiPos 1,23 : print "@X07",AnsiClrLine
print "@X0F WALL.ANS @X0ENot Found!!! @X07"
nullstr=tinkey(100)
endif
endif
if (CmdStr="BGON") then
BGon=TRUE
PrnWall(1)
endif
if (CmdStr="BGOFF") then
BGon=FALSE
PrnWall(0)
endif
if (CmdStr="BSON") BSon=TRUE
if (CmdStr="BSOFF") BSon=FALSE
if (CmdStr="LBON") LBon=TRUE
if (CmdStr="LBOFF") LBon=FALSE
if (CmdStr="VER") then
AnsiPos 1,23 : print AnsiClrLine
print "@X0C The Wall @X0F"+WallVer+"@X07 (c) 1996 by Jesse Keene"
nullstr=tinkey(200)
endif
if (CmdStr="JANITOR") then
for i = 1 to 22
WallDat(i,1)=space(79)
WallDat(i,0)=replace(space(79)," ","7")
WallDat(i,2)=replace(space(79)," ","0")
endfor
PrnWall(BGon)
endif
if (CmdStr="RANDC" | CmdStr="RC") then
:RandAgin
RandC(0)=random(15)
RandC(1)=random(15)
if (RandC(1) < 8) then
if (RandC(0)=RandC(1) | (RandC(0)-8)=RandC(1)) goto RandAgin
endif
if (RandC(0) >= 10) CurBG= RandC(0)+55
if (RandC(1) >= 10) CurClr=RandC(1)+55
if (RandC(0) < 10) CurBG= RandC(0)+48
if (RandC(1) < 10) CurClr=RandC(1)+48
endif
if (CmdStr="RANDP" | CmdStr="RP") then
PosX=1+random(78)
PosY=1+random(21)
endif
if (CmdStr="LASTIN") then
AnsiPos 1,23 : print AnsiClrLine
print " @X0FName:@X07 "+mixed(LstUsrName)
if (PSA(1) & (!LstUsrAlias="")) print " @X0FAlias:@X07 "+mixed(LstUsrAlias)
nullstr=tinkey(200)
endif
if (!upper(CmdStr)=StripStr(upper(CmdStr),"FUCK") | \
!upper(CmdStr)=StripStr(upper(CmdStr),"SHIT") ) then
AnsiPos 1,23 : print AnsiClrLine
let i=random(6)
select case (i)
case 0: print "@X0E Talk Nasty To Me, Baby!! "
case 1: print "@X0F What do you think this is, a bathroom wall?! "
case 2: print "@X0C You @X86Stink!!!@X07 "
case 3: print "@X0E You Smell Like @X8EPiss@X0E! "
case 4: print "@X07 Yeah, cussing is permitted on the wall, so what's your point?! "
case 5: print "@X8F Error:@X0F Dumbass at Keyboard "
case 6: print "@X0A Huh huh-huh huh Huh-huh huh Huh-huh huh, YOU SUCK! BUNGHOLE!@X07 "
end select
nullstr=tinkey(100)
endif
if (CmdStr="TIME" | CmdStr="CLOCK") then
AnsiPos 1,23 : print AnsiClrLine
Time_Loop=1
while (Time_Loop) do
if (!LstSec=SEC(TIME())) then
AnsiPos 1,23
print "@X"+chr(CurBG)+chr(CurClr)+" ",TimeAP(TIME())," @X07"
let LstSec=SEC(TIME())
endif
if ( asc(INKEY()) > 0 ) Time_Loop=0
endwhile
endif
if (CmdStr="DATE") then
AnsiPos 1,23
print AnsiClrLine,"@X"+chr(CurBG)+chr(CurClr)+" ",DATE()," @X07"
nullstr=tinkey(100)
endif
if (CmdStr="IDKFA" | CmdStr="DNSTUFF") then
AnsiPos 1,23 : print AnsiClrLine
print "@X0C Very Happy Ammo Added @X07"
nullstr=tinkey(100)
endif
if (CmdStr="EXIT") then
AnsiPos 1,23 : print AnsiClrLine
if (!GetYN("@X0E Save Changes Before Exiting",1)) then
if (Lock_Flag) delete ppepath()+TmpFile+string(pcbnode())
end
endif
Main_Loop=0
Loop
endif
PrnEndLine() : PrnPos()
Ctrl_A=0
endif
if (Ctrl_B) then
CurBG=Blink(CurBG)
if (DirWordz=0) then : AnsiPos 32,23
else : AnsiPos 75,23
endif
print "@X"+chr(CurBG)+chr(CurClr)+"Color@X07"
AnsiPos PosX,PosY
Ctrl_B=0
endif
if (Ctrl_T) then
if (!mid(WallDat(PosY,1),PosX,1)=" ") then
CurClr=asc(mid(WallDat(PosY,0),PosX,1))
CurBG= asc(mid(WallDat(PosY,2),PosX,1))
if (DirWordz=0) then : AnsiPos 32,23
else : AnsiPos 75,23
endif
print "@X"+chr(CurBG)+chr(CurClr)+"Color@X07"
AnsiPos PosX,PosY
endif
Ctrl_T=0
endif
if (Ctrl_C) then
CurBG=asc("0")
DispClrFlag=1
AnsiPos 1,23
print AnsiClrLine+"@X03 Select Color: "+AnsiSave
AnsiPos 32,23
print "@X09[@X0BCtrl@X03^@X0BB@X09]@X03 Change Background Color@X07"
while (Input_Flag=0) do
KeyBuf=upper(INKEY())
if (len(KeyBuf) > 1) KeyBuf=""
if (KeyBuf=ESC) then
Input_Flag=1
CurClr=asc("7") : CurBG=asc("0")
PrnEndLine() : PrnPos()
endif
if (DispClrFlag) then
print AnsiRestore
for i = 0 to 9
if (!string(i)=chr(CurBG)) print "@X"+chr(CurBG)+string(i)+string(i)
endfor
for i = 1 to 6
print "@X"+chr(CurBG)+chr(64+i)+chr(64+i)
endfor
DispClrFlag=0
endif
if (asc(KeyBuf)=2) then
if (CurBG >= asc("7")) then
CurBG=asc("0")
else
CurBG=CurBG+1
endif
DispClrFlag=1
endif
' asc 48-57 = "0-9", asc 65-70 = "A-F"
if ((asc(KeyBuf) >= 48 & asc(KeyBuf) <= 57) | \
(asc(KeyBuf) >= 65 & asc(KeyBuf) <= 70)) then
if (asc(KeyBuf)=CurBG) goto AbortInput
Input_Flag=TRUE
CurClr=asc(KeyBuf)
PrnEndLine() : PrnPos()
:AbortInput
endif
endwhile
KeyBuf=""
Input_Flag=0
AnsiPos PosX,PosY
Ctrl_C=0
endif
if (Ctrl_N) then
NumPad=SwapBool(NumPad)
AnsiPos 1,23 : print AnsiClrLine
if (NumPad=1) print "@X03 Number keys are now interpreted for cursor movement, @X0BTURN ON YOUR @X0FNUMLOCK@X07"
if (NumPad=0) print "@X03 Number keys will now get typed on The Wall, PC Arrow keys should still work@X07"
nullstr=tinkey(200)
PrnEndLine() : PrnPos()
Ctrl_N=0
endif
if (Ctrl_R) then
PrnWall(BGon)
PrnEndLine() : PrnPos()
Ctrl_R=0
endif
if (KeyBuf="RIGHT" | (NumPad=1 & KeyBuf="6")) then
inc PosX : if (PosX > 79) PosX = 1
PrnPos()
endif
if (KeyBuf="LEFT" | (NumPad=1 & KeyBuf="4")) then
dec PosX : if (PosX < 1) PosX = 79
PrnPos()
endif
if (KeyBuf="DEL" | KeyBuf="" | asc(KeyBuf)=8) then
OldX=PosX : OldY=PosY
select case (DirWordz)
case 0: dec PosX
case 1: inc PosX
case 2: dec PosY
case 3: inc PosY
case 4: dec PosX : dec PosY
case 5: dec PosX : inc PosY
default: DirWordz=0
end select
if (PosX > 79) PosX=1
if (PosX < 1) PosX=79
if (PosY > 22) PosY=1
if (PosY < 1) PosY=22
if ((BSon & asc(KeyBuf)=8) | KeyBuf="DEL" | KeyBuf="") then
WallDat(PosY,1)=Left(WallDat(PosY,1),PosX-1)+chr(32)+Right(WallDat(PosY,1),79-PosX)
AnsiPos PosX,PosY
if (BGon) then
print "@X04"+mid(StripATX(WallAsc(PosY)),PosX,1)
else
print " "
endif
endif
PrnPos()
endif
if (KeyBuf="DOWN" | (NumPad=1 & KeyBuf="2")) then
inc PosY : if (PosY > 22) PosY = 1
PrnPos()
endif
if (KeyBuf="UP" | (NumPad=1 & KeyBuf="8")) then
dec PosY : if (PosY < 1) PosY = 22
PrnPos()
endif
if (KeyBuf="HOME") then
PosX = 1 : PrnPos()
endif
if (KeyBuf="END") then
PosX = 79 : PrnPos()
endif
if (NumPad=1 & KeyBuf="7") then
dec PosY : if (PosY < 1) PosY = 22
dec PosX : if (PosX < 1) PosX = 79
PrnPos()
endif
if (NumPad=1 & KeyBuf="9") then
dec PosY : if (PosY < 1) PosY = 22
inc PosX : if (PosX > 79) PosX = 1
PrnPos()
endif
if (NumPad=1 & KeyBuf="1") then
inc PosY : if (PosY > 22) PosY = 1
dec PosX : if (PosX < 1) PosX = 79
PrnPos()
endif
if (NumPad=1 & KeyBuf="3") then
inc PosY : if (PosY > 22) PosY = 1
inc PosX : if (PosX > 79) PosX = 1
PrnPos()
endif
if (asc(KeyBuf)=13) then
inc PosY : if (PosY > 22) PosY = 1
PosX = 1
PrnPos()
endif
if (asc(KeyBuf) >= 32 | asc(KeyBuf)=9) then
if (NumPad=1 & (asc(KeyBuf) >= 48 & asc(KeyBuf) <= 57)) goto AbortKey
if (len(KeyBuf) > 1 | KeyBuf="") goto AbortKey
WallDat(PosY,1)=Left(WallDat(PosY,1),PosX-1)+KeyBuf+Right(WallDat(PosY,1),79-PosX)
WallDat(PosY,0)=Left(WallDat(PosY,0),PosX-1)+chr(CurClr)+Right(WallDat(PosY,0),79-PosX)
WallDat(PosY,2)=Left(WallDat(PosY,2),PosX-1)+chr(CurBG)+Right(WallDat(PosY,2),79-PosX)
AnsiPos PosX, PosY
if ((!KeyBuf=" ") & (!asc(KeyBuf)=9)) then
print "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)+KeyBuf
elseif (KeyBuf=" ") then
if (BGon) then
print "@X04"+mid(StripATX(WallAsc(PosY)),PosX,1)
else
print " "
endif
elseif (asc(KeyBuf)=9) then
WallDat(PosY,1)=Left(WallDat(PosY,1),PosX-1)+chr(255)+Right(WallDat(PosY,1),79-PosX)
print "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)+" "
endif
select case (DirWordz)
case 0: inc PosX
case 1: dec PosX
case 2: inc PosY
case 3: dec PosY
case 4: inc PosX : inc PosY
case 5: inc PosX : dec PosY
default: DirWordz=0
end select
if (PosX > 79) PosX=1
if (PosX < 1) PosX=79
if (PosY > 22) PosY=1
if (PosY < 1) PosY=22
PrnPos()
:AbortKey
endif
if (Ctrl_Q) Main_Loop=0 ' User hit Ctrl_Q, Exit
if (KeyBuf=ESC) then
if (!DirWordz=0) then ' ESC to Turn off Direction (Ctrl^D)
DirWordz=0
PrnEndLine() : PrnPos()
else
Ctrl_A=TRUE ' ESC hit for Command
endif
endif
endwhile
endproc
PROCEDURE LoadDAT()
if (!exist(ppepath()+"WALL.DAT")) then
wASC=FNEXT()
fopen wASC,ppepath()+"WALL.BG", O_RD, S_DB
for i = 1 to 22
WallDat(i,1)=space(79)
WallDat(i,0)=replace(space(79)," ",chr(CurClr))
WallDat(i,2)=replace(space(79)," ",chr(CurBG))
fget wASC, WallAsc(i) : WallAsc(i)=StripATX(WallAsc(i))
endfor
else
wDAT=FNEXT()
fopen wDAT,ppepath()+"WALL.DAT", O_RD, S_DB
wASC=FNEXT()
fopen wASC,ppepath()+"WALL.BG", O_RD, S_DB
for i = 1 to 22
fget wDAT, WallDat(i,1)
fget wASC, WallAsc(i)
WallDat(i,1)=Left(WallDat(i,1),79)
WallAsc(i)=StripAtx(WallAsc(i))
endfor
for i = 1 to 22
fget wDAT, WallDat(i,0)
fget wDAT, WallDat(i,2)
endfor
fget wDAT, LstUsrName
fget wDAT, LstUsrAlias
endif
fclose wASC
fclose wDAT
ENDPROC
PROCEDURE SaveDAT()
wDAT=FNEXT()
fcreate wDAT,ppepath()+"WALL.DAT",O_WR,S_DB
for i = 1 to 22
fputln wDAT, Left(WallDat(i,1),79)
endfor
for i = 1 to 22
fputln wDAT, Left(WallDat(i,0),79)
fputln wDAT, Left(WallDat(i,2),79)
endfor
fputln wDAT, U_NAME()
if (PSA(1)) fputln wDAT, U_ALIAS()
fclose wDAT
ENDPROC
PROCEDURE PrnWall(int ShowBG)
byte LastClr, LastBGClr
boolean BG_Stat
cls
print "@POFF@" ' Disable pausing
if (ShowBG=1) dispstr "%"+ppepath()+"WALL.BG"
AnsiPos 1,1
OldX=PosX : OldY=PosY
PosY=0
while (PosY < 22) do
inc PosY
PosX=0
while (PosX < 79) do
inc PosX
if (mid(WallDat(PosY,1),PosX,1)=" ") then
BG_Stat=1
if (TRIM(Right(WallDat(PosY,1),79-PosX)," ")="") break
PosX=79-len(LTRIM(Right(WallDat(PosY,1),79-PosX)," "))
else
if (!chr(LastClr)=mid(WallDat(PosY,0),PosX,1) | (!chr(LastBGClr)=mid(WallDat(PosY,2),PosX,1)) | BG_Stat=1) then
if (BG_Stat=1) ansipos PosX,PosY
print "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)
LastClr =asc(mid(WallDat(PosY,0),PosX,1))
LastBGClr=asc(mid(WallDat(PosY,2),PosX,1))
endif
if (asc(mid(WallDat(PosY,1),PosX,1))=255) then
print " "
else
print mid(WallDat(PosY,1),PosX,1)
endif
BG_Stat=0
if (PosX >= 79) BG_Stat=1
endif
endwhile
endwhile
PosX=OldX : PosY=OldY
endproc
PROCEDURE PrnPos()
AnsiPos 1,23 : print ESC+"[0m"
if (PosY < 10) print "@POS:2@"
print PosY,",@POS:4@",PosX," "
AnsiPos PosX,PosY
endproc
PROCEDURE PrnEndLine()
string DirWord
AnsiPos 1,23 : print "@X07"+AnsiClrLine
if (DirWordz=0) then
if (NumPad=TRUE) then
AnsiPos 7,23 : print "@X02Use Number Pad"
else
AnsiPos 7,23 : print "@X02Use Arrow Keys"
endif
AnsiPos 23,23 : print "@X09[@X0BCtrl@X03^@X0BC@X09] @X"+chr(CurBG)+chr(CurClr)+"Color"
AnsiPos 39,23 : print "@X09[@X03^@X0BB@X09]@X07 Blink"
AnsiPos 51,23 : print "@X09[@X03^@X0BZ@X09]@X07 Help"
AnsiPos 62,23 : print "@X09[@X0FCtrl@X03^@X0FQ@X09]@X03 to Quit@X07"
else
select case (DirWordz)
case 1: DirWord="backwards"
case 2: DirWord="downwards"
case 3: DirWord="upwards"
case 4: DirWord="diagnally"
case 5: DirWord="diagnally-up"
end select
AnsiPos 1,23 : print "@X07"
print AnsiClrLine+"@POS:7@@X03 Everything will get typed "+DirWord+" ... ESC to return to normal","@POS:75@@X"+chr(CurBG)+chr(CurClr)+"Color"
endif
endproc
FUNCTION Blink(byte iBG) BYTE
if (iBG=asc("0")) Blink=asc("8")
if (iBG=asc("1")) Blink=asc("9")
if (iBG=asc("2")) Blink=asc("A")
if (iBG=asc("3")) Blink=asc("B")
if (iBG=asc("4")) Blink=asc("C")
if (iBG=asc("5")) Blink=asc("D")
if (iBG=asc("6")) Blink=asc("E")
if (iBG=asc("7")) Blink=asc("F")
if (iBG=asc("8")) Blink=asc("0")
if (iBG=asc("9")) Blink=asc("1")
if (iBG=asc("A")) Blink=asc("2")
if (iBG=asc("B")) Blink=asc("3")
if (iBG=asc("C")) Blink=asc("4")
if (iBG=asc("D")) Blink=asc("5")
if (iBG=asc("E")) Blink=asc("6")
if (iBG=asc("F")) Blink=asc("7")
ENDFUNC
FUNCTION Lock() BOOLEAN
boolean L
int ChanNum
ChanNum=FNEXT()
if (Lock_Flag) then
if (!findfirst(ppepath()+TmpFile+"*")="") then
L=1
else
FCREATE ChanNum, PPEPATH()+TmpFile+string(pcbnode()), O_WR, S_DW
fclose ChanNum
L=0
endif
else
L=0
endif
Lock=L
ENDFUNC
FUNCTION GetYN(string Prompt, boolean YN) BOOLEAN
string EndPrompt, KeyBuffer, YNnlb
boolean LOOP_Flag, YNStat, DispFlag
if (!LBon) then
if (YN) then : YNnlb="Y"
else : YNnlb="N"
endif
INPUTSTR Prompt, YNnlb, 0Fh, 1, "ynYN", FIELDLEN + GUIDE + UPCASE + ERASELINE
if (upper(YNnlb)="Y") GetYN=1
if (upper(YNnlb)="N") GetYN=0
goto eogyn
endif
EndPrompt= "@X09[@X07Yes@X09] [@X07No@X09]@X07"
YNStat=YN
DispFlag=1
LOOP_Flag=1
print Prompt
print "?@X07 ", AnsiSave, EndPrompt
while (LOOP_Flag) do
KeyBuffer = INKEY()
if (upper(KeyBuffer)="Y") then
YNStat=1
DispFlag=1
LOOP_Flag=0
elseif (upper(KeyBuffer)="N") then
YNStat=0
DispFlag=1
LOOP_Flag=0
endif
if (KeyBuffer="RIGHT" | KeyBuffer="LEFT" | KeyBuffer="4" | KeyBuffer="6" | asc(KeyBuffer)=32 | KeyBuffer="+" | KeyBuffer="-") then
YNStat=SwapBool(YNStat)
DispFlag=1
endif
' 13 = Enter Key
if (asc(KeyBuffer)=13 | KeyBuffer=ESC) LOOP_Flag=0
if (DispFlag) then
if (YNStat) then
print AnsiRestore
forward 7
print "@X07No@X07"
backup 8
print "@X1EYes@X07"
else
print AnsiRestore
forward 1
print "@X07Yes@X07"
forward 3
print "@X1ENo@X07"
endif
endif
DispFlag=0
endwhile
GetYN=YNStat
:eogyn
ENDFUNC
FUNCTION SwapBool(Boolean swp) BOOLEAN
if (swp=1) SwapBool=0
if (swp=0) SwapBool=1
ENDFUNC
FUNCTION Direction(string Prompt) INT
string EndPrompt, KeyBuffer
string AnsiSave, AnsiRestore, TheWord(5)
boolean LOOP_Flag
int DirStat, TheSpot(5)
TheWord(0)="@X0FF@X07orward" : TheSpot(0)=21
TheWord(1)="@X0FB@X07ackward" : TheSpot(1)=31
TheWord(2)="@X0FD@X07own" : TheSpot(2)=42
TheWord(3)="@X0FU@X07p" : TheSpot(3)=49
TheWord(4)="@X07D@X0Fi@X07agnal" : TheSpot(4)=54
TheWord(5)="@X07Di@X0Fa@X07gnal-Up" : TheSpot(5)=64
EndPrompt= "@X09[@X0FF@X07orward@X09] [@X0FB@X07ackward@X09] [@X0FD@X07own@X09] [@X0FU@X07p@X09] [@X07D@X0Fi@X07agnal@X09] [@X07Di@X0Fa@X07gnal-Up@X09]@X07"
DirStat=0 : LOOP_Flag=1
AnsiPos 1,23 : print Prompt : AnsiPos 20,23 : print EndPrompt
AnsiPos TheSpot(0),23
print "@X1E"+StripATX(TheWord(0))+"@X07"
while (LOOP_Flag) do
KeyBuffer = INKEY()
if (upper(KeyBuffer)="F") then : DirStat=0 : LOOP_Flag=0
elseif (upper(KeyBuffer)="B") then : DirStat=1 : LOOP_Flag=0
elseif (upper(KeyBuffer)="D") then : DirStat=2 : LOOP_Flag=0
elseif (upper(KeyBuffer)="U") then : DirStat=3 : LOOP_Flag=0
elseif (upper(KeyBuffer)="I") then : DirStat=4 : LOOP_Flag=0
elseif (upper(KeyBuffer)="A") then : DirStat=5 : LOOP_Flag=0
endif
' 8=Backspace
if (KeyBuffer="LEFT" | KeyBuffer="4" | KeyBuffer="-" | asc(KeyBuffer)=8) then
AnsiPos TheSpot(DirStat),23
print TheWord(DirStat)
dec DirStat
if (DirStat < 0) DirStat=5
AnsiPos TheSpot(DirStat),23
print "@X1E"+StripATX(TheWord(DirStat))+"@X07"
endif ' 32=Space
if (KeyBuffer="RIGHT" | KeyBuffer="6" | KeyBuffer="+" | asc(KeyBuffer)=32) then
AnsiPos TheSpot(DirStat),23
print TheWord(DirStat)
inc DirStat
if (DirStat > 5) DirStat=0
AnsiPos TheSpot(DirStat),23
print "@X1E"+StripATX(TheWord(DirStat))+"@X07"
endif
' 13 = Enter Key
if (asc(KeyBuffer)=13 | KeyBuffer=ESC) then
if (KeyBuffer=ESC) DirStat=0
Loop_Flag=0
endif
endwhile
Direction=DirStat
endfunc
PROCEDURE SaveANS(string SavANSfilename)
byte LastClr, LastBGClr
boolean BG_Stat
int CurSavLine
int wANS
wANS=FNEXT()
if (SavANSfilename="") SavANSfilename="WALL.ANS"
AnsiPos 1,23 : print AnsiClrLine,"@X07Saving "+SavANSfilename+" ... ",AnsiSave
fcreate wANS, ppepath()+SavANSfilename,O_WR,S_DB
OldX=PosX : OldY=PosY
CurSavLine=23
fput wANS, ESC+"[0;0H"
PosY=0
while (PosY < 22) do
inc PosY
PosX=0
while (PosX < 79) do
inc PosX
if (mid(WallDat(PosY,1),PosX,1)=" ") then
BG_Stat=1
if (TRIM(Right(WallDat(PosY,1),79-PosX)," ")="") break
PosX=79-len(LTRIM(Right(WallDat(PosY,1),79-PosX)," "))
else
if (!chr(LastClr)=mid(WallDat(PosY,0),PosX,1) | (!chr(LastBGClr)=mid(WallDat(PosY,2),PosX,1)) | BG_Stat=1) then
if (BG_Stat=1) fput wANS, ESC+"["+string(PosY)+";"+string(PosX)+"f"
fput wANS, "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)
LastClr =asc(mid(WallDat(PosY,0),PosX,1))
LastBGClr=asc(mid(WallDat(PosY,2),PosX,1))
endif
if (asc(mid(WallDat(PosY,1),PosX,1))=255) then
fput wANS, " "
else
fput wANS, mid(WallDat(PosY,1),PosX,1)
endif
BG_Stat=0
if (PosX >= 79) BG_Stat=1
endif
endwhile
print AnsiRestore,string(CurSavLine)," "
dec CurSavLine
fputln wANS, ""
endwhile
PosX=OldX : PosY=OldY
print AnsiRestore,"@X0FDone@X07"
nullstr=tinkey(9)
fclose wANS
endproc
PROCEDURE SavePCB(String SavPCBfilename)
byte LastClr, LastBGClr
boolean BG_Stat
int CurSavLine
int wPCB
if (SavPCBfilename="") SavPCBfilename="WALL.PCB"
AnsiPos 1,23 : print AnsiClrLine,"@X07Saving "+SavPCBfilename+" ... ",AnsiSave
wPCB=FNEXT()
fcreate wPCB, ppepath()+SavPCBfilename,O_WR,S_DB
OldX=PosX : OldY=PosY
BG_Stat=1
fput wPCB, "@CLS@"
CurSavLine=23
PosY=0
while (PosY < 22) do
inc PosY
PosX=0
fput wPCB, "@X04"
while (PosX < 79) do
inc PosX
if (mid(WallDat(PosY,1),PosX,1)=" ") then
if (BG_Stat=0) fput wPCB, "@X04"
fput wPCB, mid(WallAsc(PosY),PosX,1)
BG_Stat=1
else
if (!chr(LastClr)=mid(WallDat(PosY,0),PosX,1) | (!chr(LastBGClr)=mid(WallDat(PosY,2),PosX,1)) | BG_Stat=1) then
if (BG_Stat=1) then
endif
fput wPCB, "@X"+mid(WallDat(PosY,2),PosX,1)+mid(WallDat(PosY,0),PosX,1)
LastClr =asc(mid(WallDat(PosY,0),PosX,1))
LastBGClr=asc(mid(WallDat(PosY,2),PosX,1))
endif
if (asc(mid(WallDat(PosY,1),PosX,1))=255) then
fput wPCB, " "
else
fput wPCB, mid(WallDat(PosY,1),PosX,1)
endif
BG_Stat=0
if (PosX >= 79) BG_Stat=1
endif
endwhile
print AnsiRestore,string(CurSavLine)," "
dec CurSavLine
fputln wPCB, ""
endwhile
print AnsiRestore,"@X0FDone@X07"
nullstr=tinkey(9)
PosX=OldX : PosY=OldY
fclose wPCB
endproc
PROCEDURE Send()
string CmdStr,Sender
boolean RetRec,StS
int cn
getuser
if (U_Alias()="") then : Sender=mixed(U_NAME())
else : Sender=mixed(U_ALIAS())
endif
AnsiPos 1,23 : print "@X07",AnsiClrLine
InputText "@X0E Send Wall (Blank=Send to Yourself): User",CmdStr,@X07,24
let CmdStr=upper(trim(CmdStr," "))
if (CmdStr="") then
CmdStr=U_NAME()
StS=1
endif
AnsiPos 1,23 : print "@X07",AnsiClrLine
GetAltUser U_RECNUM(CmdStr)
if (CurUser() < 0) then
print "@X0E "+CmdStr+": User Not Found!@X07 "
nullstr=tinkey(100)
else
cn=FNEXT()
FCreate cn, ppepath()+"SEND.TMP", o_rw, s_dw
fputln cn, " Sender"+chr(58)+" "+Sender
fputln cn, ""
if (!StS) then
fputln cn, " This was sent to you from inside The Wall "
fputln cn, " Using the @X0BSEND@X07 command "
endif
fputln cn, "@WAIT@"
FClose cn
SavePCB("WALL.SND")
append PPEPATH()+"WALL.SND",PPEPATH()+"SEND.TMP"
delete PPEPATH()+"WALL.SND"
rename PPEPATH()+"SEND.TMP",PPEPATH()+"WALL.SND"
' message conf,to,from,sub,sec,pack,rr,echo,file
message 0,U_NAME(),"THE WALL","Send","R",0,0,0,ppepath()+"WALL.SND"
AnsiPos 1,23 : print "@X07",AnsiClrLine
print " Wall Send to "+mixed(U_NAME())
nullstr=tinkey(100)
endif
GetUser
ENDPROC